#include  "Sort.h"

#define TEST_HEADER printf("\n*****************************%s******************\n",__FUNCTION__)


void TestBubbleSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    BubbleSort(arr,size);
    SortPrintInt(arr,size,"进行冒泡排序后：");
}
void TestSeleteSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    SeleteSort(arr,size);
    SortPrintInt(arr,size,"进行选择排序后：");
}
void TestInsertSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    InsertSort(arr,size);
    SortPrintInt(arr,size,"进行插入排序后：");
}
void TestHeapSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    HeapSort(arr,size);
    SortPrintInt(arr,size,"进行堆排序后：");
}
void TestShellSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    ShellSort(arr,size);
    SortPrintInt(arr,size,"进行希尔排序后：");
}
void TestMergeSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    MergeSort(arr,size);
    SortPrintInt(arr,size,"进行归并排序后：");
}
void TestQuickSort()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    QuickSort(arr,size);
    SortPrintInt(arr,size,"进行快速排序后：");
}
void TestMergeSortByLoop()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    MergeSortByLoop(arr,size);
    SortPrintInt(arr,size,"进行归并排序后：");
}
void TestQuickSortByLoop()
{
    TEST_HEADER;
    int arr[]={9,5,2,7,3,10,1,8,4,6};
    int64_t size=sizeof(arr)/sizeof(arr[0]);
    QuickSortByLoop(arr,size);
    SortPrintInt(arr,size,"进行快速排序后：");
}
int main()
{

    TestBubbleSort();
    TestSeleteSort();
    TestInsertSort();
    TestHeapSort();
    TestShellSort();
    TestMergeSort();
    TestMergeSortByLoop();
    TestQuickSort();
    TestQuickSortByLoop();
    return 0;
}
